<?php

namespace app\admin\model\contract;

use think\Model;


class Record extends Model
{

    

    

    // 表名
    protected $name = 'contract_record';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'contract_status_text'
    ];
    

    
    public function getContractStatusList()
    {
        return ['0' => __('Contract_status 0'), '1' => __('Contract_status 1'), '2' => __('Contract_status 2'), '3' => __('Contract_status 3'), '4' => __('Contract_status 4'), '5' => __('Contract_status 5'), '6' => __('Contract_status 6'), '7' => __('Contract_status 7'), '8' => __('Contract_status 8'), '9' => __('Contract_status 9'), '10' => __('Contract_status 10'), '21' => __('Contract_status 21')];
    }


    public function getContractStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['contract_status']) ? $data['contract_status'] : '');
        $list = $this->getContractStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
